-
Notifications
You must be signed in to change notification settings - Fork 790
[Benchmarks] Print all important env vars in debug logs #20415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
Print also PATH and LD_LIBRARY_PATH when these are modified in benchmark commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix problem with overwriting LD_LIBRARY_PATH and PATH passed in env_vars
Fixed |
for key, value in env_vars.items(): | ||
old_value = env.get(key, "") | ||
if old_value: | ||
env[key] = os.pathsep.join([value, old_value]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if key on env_vars is not a path, but something existing in env which user wanted to overwrite?
This code is getting more and more complex...
Maybe we can just assume that neither PATH, nor LD_LIBRARY_PATH is not present in env_vars (assert on this) and assume that env_vars overwrite vars and append only PATHS and LD_LIBRARY_PATH from ld_library and add_sycl params.
Sorry that I did not realized this earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this has to be handled well. Unluckily, this assumption is not true, I've checked that. Proposed another solution where there is a neat check and paths are added only to PATH
and LD_LIBRARY_PATH
. These are the only env vars used in the framework that are lists of paths. All other are just replaced.
log.debug(f"Running: {full_command_str}") | ||
|
||
# Prepend new value to existing env value | ||
for key, value in env_vars.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now, reading it for the second time I'm wondering.. why do we even have this env_vars
? just to print it? If so, why not skip env_vars
, set env
above, and just print in debug log PATH
and LD_LIBRARY_PATH
from env
...?
Right now, we print something (env_vars
), but actually using something else (env
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to clutter verbose logs with paths in PATH that are not relevant to benchmarks. It's better to have only relevant paths co I could reproduce easily the env needed to run given commands by hand on the same or other machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and no, the other PATHs can actually influence the benchmark... ;)
I still believe my point is valid - we print something (env_vars
), but actually using something else for running the command (env
).
Anyway, I guess we can live with the currently proposed implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know that the other PATHs could make a difference, but see what is printed now... no PATHs :) From my experience, only these added here are relevant for a quick debug. And that's what I was missing - we printed some env vars, but they were not enough to actually use the printed command and execute it apart from the framework.
heh, I think both Łukasz and myself got to the same conclusion - "This code is getting more and more complex..." 😃 |
Print also PATH and LD_LIBRARY_PATH when these are modified in benchmark commands.